//底部菜单
mui('body').on('tap', '.mui-tab-item', function() {
	window.top.location.href = this.href;
	$(this).addClass("mui-active");
});

//消息
mui('body').on('tap', '#my_news', function() {
	window.top.location.href = "fx_message.html";
});

//我的
mui('body').on('tap', '#user', function() {
	window.top.location.href = "../my/my.html";
});
//我的-消息之粉丝
mui('body').on('tap', '#fx_fensi', function() {
	window.top.location.href = "fx_fensi.html";
});
//我的-消息之标记
mui('body').on('tap', '#tag', function() {
	window.top.location.href = "tag.html";
});
//我的-消息之评论
mui('body').on('tap', '#news_comment', function() {
	window.top.location.href = "news_comment.html";
});
//我的-消息之伏羲小助手
mui('body').on('tap', '#news_assistant', function() {
	window.top.location.href = "news_assistant.html";
});

//发布动态
mui('body').on('tap', '.public_menu_img a', function() {
	var sta = $(this).attr("sta");
	var mag = $("#mag").val(); //提示  
	if(mag == "请先登录") { //判断是否登录 
		var btnArray = ['否', '是'];
		mui.confirm(mag, '提示', btnArray, function(e) {
			if(e.index == 1) {
				mui.openWindow({
					url: '../user/login.html',
					id: 'login',
				});
			} else {}
		})
	} else if(sta == 1) { //发布图文
		mui.openWindow({
			url: '../index/issued_by.html',
			id: 'issued_by',
		});
	} else if(sta == 2) { //发布视频
		mui.openWindow({
			url: '../index/issued_video.html',
			id: 'issued_video',
		});
	}

});


//二级按钮退出APP
var first = null;
mui.back = function() {
	//	首次按键，提示‘再按一次退出应用’
	if(!first) {
		first = new Date().getTime();
		mui.toast('再按一次退出应用');
		setTimeout(function() {
			first = null;
		}, 1000);
	} else {
		if(new Date().getTime() - first < 1000) {
			plus.runtime.quit();
		}
	}
};